package com.springscheduled.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author chenming
 * @description
 * @create: 2022-02-17
 */
@Component
@Slf4j
public class TaskTest {

//    @Scheduled(fixedRate = 2000)
    public void test1() throws InterruptedException {
        log.info(Thread.currentThread().getName() + "test1");
    }

    @Scheduled(fixedRate = 20000)
    public void test2() throws InterruptedException {
        log.info(Thread.currentThread().getName() + "test2");
    }



}
